<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>follow-频道主画面</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="css/mui.min.css">
		<style>
			html,
			body {
				background-color: #efeff4;
			}
			
			.mui-bar~.mui-content .mui-fullscreen {
				top: 44px;
				height: auto;
			}
			
			.mui-pull-top-tips {
				position: absolute;
				top: -20px;
				left: 50%;
				margin-left: -25px;
				width: 40px;
				height: 40px;
				border-radius: 100%;
				z-index: 1;
			}
			
			.mui-bar~.mui-pull-top-tips {
				top: 24px;
			}
			
			.mui-pull-top-wrapper {
				width: 42px;
				height: 42px;
				display: block;
				text-align: center;
				background-color: #efeff4;
				border: 1px solid #ddd;
				border-radius: 25px;
				background-clip: padding-box;
				box-shadow: 0 4px 10px #bbb;
				overflow: hidden;
			}
			
			.mui-pull-top-tips.mui-transitioning {
				-webkit-transition-duration: 200ms;
				transition-duration: 200ms;
			}
			
			.mui-pull-top-tips .mui-pull-loading {
				/*-webkit-backface-visibility: hidden;
				-webkit-transition-duration: 400ms;
				transition-duration: 400ms;*/
				margin: 0;
			}
			
			.mui-pull-top-wrapper .mui-icon,
			.mui-pull-top-wrapper .mui-spinner {
				margin-top: 7px;
			}
			
			.mui-pull-top-wrapper .mui-icon.mui-reverse {
				/*-webkit-transform: rotate(180deg) translateZ(0);*/
			}
			
			.mui-pull-bottom-tips {
				text-align: center;
				background-color: #efeff4;
				font-size: 15px;
				line-height: 40px;
				color: #777;
			}
			
			.mui-pull-top-canvas {
				overflow: hidden;
				background-color: #fafafa;
				border-radius: 40px;
				box-shadow: 0 4px 10px #bbb;
				width: 40px;
				height: 40px;
				margin: 0 auto;
			}
			
			.mui-pull-top-canvas canvas {
				width: 40px;
			}
			
			.mui-slider-indicator.mui-segmented-control {
				background-color: #efeff4;
				font-size: 20px;
				top: 5px;
			}
			
			.myprofile {
				height: 36px;
				width: 36px;
				border-radius: 36px;
				border: none;
			}
			
			.upload {
				height: 36px;
				width: 36px;
				margin-top: -37px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<div id="profile">
				<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
					<img class="mui-btn-link myprofile" id="myprofile" src="images/user-photo.png"/>
				</div>
			<div id="layout1" style="position: absolute; width: 60%; height: 28px; z-index: 1; left: 24%; top: 5%">
				<p class="mui-input-row mui-search">
					<input type="search" class="mui-input-clear" placeholder="">
				</p>
			</div>
			<img class="mui-pull-right mui-btn-link upload" id="upload" src="" /> 
		</header>
		<div class="mui-content">
			<div id="slider" class="mui-slider mui-fullscreen">
				<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<div class="mui-scroll">
						<a class="mui-control-item mui-active" href="#item0mobile" data-wid="follow-subpage-0.html">推荐</a>
						<a class="mui-control-item" href="#item1mobile" data-wid="follow-subpage-1.html">歌舞</a>
						<a class="mui-control-item" href="#item2mobile" data-wid="follow-subpage-2.html">美食</a>
						<a class="mui-control-item" href="#item3mobile" data-wid="follow-subpage-3.html">旅行</a>
						<a class="mui-control-item" href="#item4mobile" data-wid="follow-subpage-4.html">萌宠</a>
						<a class="mui-control-item" href="#item5mobile" data-wid="follow-subpage-5.html">教育</a>
						<a class="mui-control-item" href="#item6mobile" data-wid="follow-subpage-6.html">同好</a>
						<a class="mui-control-item" href="#item7mobile" data-wid="follow-subpage-7.html">养生</a>
						<a class="mui-control-item" href="#item8mobile" data-wid="follow-subpage-8.html">体健</a>
						<a class="mui-control-item" href="#item9mobile" data-wid="follow-subpage-9.html">综合</a>
					</div>
				</div>

			</div>
		</div>
		<script src="js/mui.min.js"></script>
		<script src="js/webviewGroup.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/common.js"></script>
		<script src="js/app.js"></script>
		<script>
			mui.init({
				subpages:[{   //下边是初始化，然后这个页面显示我们将插入的页面
					url:"follow-subpage-0.html",
					id:"follow-subpage-0.html",
					styles:{
						top:"0px",
						bottom:"0px"
					}
				}]
		    });
			
			mui.plusReady(function() {
				var _self = plus.webview.currentWebview();
				var group = new webviewGroup(_self.id, {
					items: [{
						id: "follow-subpage-0.html",
						url: "follow-subpage-0.html",
						extras: {}
					}, {
						id: "follow-subpage-1.html",
						url: "follow-subpage-1.html",
						extras: {}
					}, {
						id: "follow-subpage-2.html",
						url: "follow-subpage-2.html",
						extras: {}
					}, {
						id: "follow-subpage-3.html",
						url: "follow-subpage-3.html",
						extras: {}
					}, {
						id: "follow-subpage-4.html",
						url: "follow-subpage-4.html",
						extras: {}
					}, {
						id: "follow-subpage-5.html",
						url: "follow-subpage-5.html",
						extras: {}
					}, {
						id: "follow-subpage-6.html",
						url: "follow-subpage-6.html",
						extras: {}
					}, {
						id: "follow-subpage-7.html",
						url: "follow-subpage-7.html",
						extras: {}
					}, {
						id: "follow-subpage-8.html",
						url: "follow-subpage-8.html",
						extras: {}
					}, {
						id: "follow-subpage-9.html",
						url: "follow-subpage-9.html",
						extras: {}
					}],
					onChange: function(obj) {
						var c = document.querySelector(".mui-control-item.mui-active");
						if(c) {
							c.classList.remove("mui-active");
						}
						var target = document.querySelector(".mui-scroll .mui-control-item:nth-child(" + (parseInt(obj.index) + 1) + ")");
						target.classList.add("mui-active");
						if(target.scrollIntoView) {
							target.scrollIntoView();
						}
					}
				});
				mui(".mui-scroll").on("tap", ".mui-control-item", function(e) {
					var wid = this.getAttribute("data-wid");
					group.switchTab(wid);
				});

				//头像
				var myprofile = document.getElementById('myprofile');
				myprofile.src = plus.storage.getItem("headimgurl");
				myprofile.addEventListener('tap', function(event) {
					mui.openWindow({
						id: 'myprofile',
						show: {
							aniShow: 'pop-in'
						},
						styles: {
							popGesture: 'hide'
						},
						waiting: {
							autoShow: false
						}
					});
				});

				//上传
				var uploadButton = document.getElementById('upload');
				uploadButton.addEventListener('tap', function(event) {
					mui.openWindow({
						id: 'upload',
						show: {
							aniShow: 'pop-in'
						},
						styles: {
							popGesture: 'hide'
						},
						waiting: {
							autoShow: false
						}
					});
				});
			});
			mui.back = function() {
				var _self = plus.webview.currentWebview();
				_self.close("auto");
			}
		</script>
	</body>

</html>
